﻿@using Common.BaseLibrary.Authorization
@model List<DepartmentWork.Model.MenuViewModel>
<div id="sidebar_menu" class="sidebar-menu" style="height: 435px;">
    <nav id="menu" class="nav-main" role="navigation">
        <ul class="nav nav-sidebar">
            @*<div class="panel-body text-center">
                            <div class="bk-avatar">
                                <img src="@Url.Content("~/Assets/img/avatar.jpg")" class="img-circle bk-img-60" alt="">
                            </div>
                            <div class="bk-padding-top-10">
                                <i class="fa fa-circle text-success"></i>&emsp;
                                    <label style="font-size: medium">@CurrentUser.UserName</label>
                            </div>
                        </div>*@
            @*<div class="divider2"></div>*@

            @{
                var list = this.Model.FindAll(r => r.BOOT_MENU_ID == 0).ToList();//获取所有根节点菜单
                for (int i = 0; i < list.Count(); i++)
                {
                    var item = list[i];
                    if (item.CHILDEN_COUNT == 0)
                    {
                <li>
                    <a href="@Url.Action(item.ACTION_NAME, item.CONTROLLER_NAME, new { area = item.AREA_NAME })">
                        <i class="@item.MENU_CLASS" aria-hidden="true"></i><span>@item.MENU_NAME</span>
                    </a>
                </li>
                    }
                    else
                    {
                        <li class="nav-parent">
                            <a>
                                <i class="@item.MENU_CLASS" aria-hidden="true"></i><span>@item.MENU_NAME</span>
                            </a>
                            <ul class="nav nav-children" style="display: none;">
                                            @{
                                                for (int j = 0; j < this.Model.Count(); j++)
                                                {
                                                    if (this.Model[j].BOOT_MENU_ID==item.MENU_ID)
                                                    {
                                                        @*<li><a href="@Url.Action(this.Model[j].ACTION_NAME, this.Model[j].CONTROLLER_NAME,new{area=this.Model[j].AREA_NAME})"><span class="text">@this.Model[j].MENU_NAME</span></a></li>*@
                                                <li><a href='http://localhost:13129/@this.Model[j].AREA_NAME/@this.Model[j].CONTROLLER_NAME/@this.Model[j].ACTION_NAME' ><span class="text">@this.Model[j].MENU_NAME</span></a></li>
                                                        @*<li><a href='http://localhost:60725/@this.Model[j].AREA_NAME/@this.Model[j].CONTROLLER_NAME/@this.Model[j].ACTION_NAME' ><span class="text">@this.Model[j].MENU_NAME</span></a></li>*@
                                                    }
                                                }
                                            }
                                        </ul>
                        </li>
                
                    }

                }
            }
        </ul>
    </nav>
</div>
